1. Field of the Invention
The present invention relates to a data input apparatus which is simple in structure and has a key matrix and means capable of easily detecting which keys of the key matrix have been operated.
2. Description of the Related Art
As is known in the art, electronic apparatuses such as TV receivers and video tape recorders comprise a data input apparatus which has a key matrix and a microcomputer designed to detect which keys of a key matrix have been operated.
The key matrix comprises N lines of a first group, M lines of a second group, and M.times.N key switches. The lines of the first group extend parallel to one another. The lines of the second group extend parallel to one another, and intersect at right angles with the lines of the first group. The key switches are located at the intersections of the lines of the first group and the lines of the second group. The microcomputer has M input ports and N output ports are connected to the lines of the first group, and the M input ports are connected to the lines of the second group. The microcomputer outputs, at the output ports, drive signals which are normally at a high level and periodically at a low level. The microcomputer is designed to output one low-level signal at a time to the output parts. In other words, it outputs a sequence of low-level signals from the output ports to N lines of the first group. The periodic low-level signals are output to each of the N lines, but only one of the N lines is a low-level at any time.
The microcomputer outputs a sequence of low-level drive signals to the first group of lines. If any one of the key switches is turned on, the microcomputer receives a low-level input signal at ,the input port connected to of the second group of lines (which are also coupled to the key switch). Therefore, the microcomputer can determine which key switch has been turned on by detecting which input port receives a low-level input signal in light of which output port supplied a low-level signal.
To determine which key switch has been turned on, the microcomputer needs to have M+N ports, i.e., M input ports and N output ports. The more ports a microcomputer has, the more difficult it is to manufacture the microcomputer in the form of an LSI circuit. Generally, a microcomputer requires 2.sqroot.K or more ports when used in combination with a key matrix having K key switches.
A data input apparatus is known which has a microcomputer having only one input port and N output ports. This microcomputer can, therefore, be readily made in the form of an LSI circuit. It is combined with a key matrix, thus forming a data input apparatus. The key matrix comprises N lines of a first group, extending parallel to one another, and M lines of a second group, extending parallel to one another and intersecting with the lines of the first group at right angles, and key switches located at the intersections of the lines of the first group and lines of the second group. The N lines of the first group are connected to the N output ports of the microcomputer. Each key switch is connected, at one end, to one line of the first group. Resistors are provided on each line of the first group, and located between the connecting points of the line and the key switches. Each M lines of the second group is connected to the sole input port of the microcomputer and to one end of a resistor, the resistors are coupled at the other end to a constant-voltage terminal. A DC voltage is applied to this terminal.
The output ports of the microcomputer are usually open. The microcomputer is designed to output low-level signals sequentially, not simultaneously, through the output ports. In other words, the low-level signals are supplied to the lines of the first group, one after another. Further, the microcomputer can convert the voltage, which has been applied to the input port, into digital data representing this voltage.
A low-level signal is sequentially output from the output ports of the microcomputer. If any of the key switches is turned on, a unique voltage identifying the key switch is applied to the input port of the microcomputer at the same time The microcomputer can therefore determine which key switch has been turned on, in accordance with the level of the input voltage at the time of outputting a low-level signal.
This data input apparatus is advantageous in that the microcomputer requires only one input port. The number J of all ports which the microcomputer must have in this case is given: EQU J=1+{K/(I+1)}
where K is the number of key switches of the key matrix, and I is the number of resistors connected on a single line of the first group.
When the key matrix has 32 key switches, seven resistors are connected on the line of the first group. Hence, the number J of ports required is: EQU J=1+{32/(7+1)}=5
That is, the microcomputer requires one input port and four output ports in this instance.
Although the microcomputer has less ports, it requires more resistors than in the conventional data input apparatus. Consequently, this data input apparatus is, after all, as complex as the conventional one.
Generally, data input apparatuses of this type require more than H resistors, H being given: EQU H=I {L/(I+1)}+1
For example, when the key matrix of the apparatus has 32 key switches, seven resistors must be connected on the line of the first group. Hence, the number H of resistors is: EQU H=7{32/(7+1)}+1=29
As can be understood above, the conventional data input apparatus must be provided with a microcomputer which has many ports. To reduce the required number of ports which the microcomputer needs, the microcomputer must have more resistors.